package com.util;

import java.sql.Connection;
import java.sql.DriverManager;

import com.demo.Demo;
import com.model.Config;

public class ConnectDB {
	public static Connection getDBConnect() throws Exception
	{
		Config config=Demo.getConfig();
		String user=config.getDbUsername();
		String password=config.getDbPassword();
		String connectStr=config.getDbURL();
		Connection conn = null;
		Class.forName(config.getDbDriver()).newInstance();
		conn = DriverManager.getConnection(connectStr, user, password);
		return conn;
	}
}
